package com.dana.system.manager;

import com.core.constants.CacheConstant;
import com.dana.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;



@Component
public class QuestionCacheManager {
    @Autowired
    private RedisService redisService;

    /**
     * 将题目id存储到q:l:下
     * @param questionId
     */
    public void addCache(Long questionId){
        redisService.leftPushForList(CacheConstant.QUESTION_LIST,questionId);
    }

    /**
     * 将题目id在q:l: 下删除
     * @param questionId
     */
    public void deleteCache(Long questionId){
        redisService.removeForList(CacheConstant.QUESTION_LIST,questionId);
    }
}
